<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">编辑设备读取状态</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">
                    <form class="am-form tpl-form-line-form" id="deviceInformationForm" method="post">
                        <input type="hidden" id="id" name="id" th:value="${record.id}"/>

                        <!--读取状态(state)-->
                        <div class="am-form-group">
                            <label for="state" class="am-u-sm-2 am-form-label">读取状态
                                <span class="tpl-form-line-small-title">state</span>
                            </label>
                            <div class="am-u-sm-10">
                                <div class="am-form-group" id="state">
                                    <input type="radio" class="am-form-group" name="state" value="0"
                                           th:checked="${record.state != null and record.state == '0'}">未读取</input>
                                    <input type="radio" class="am-form-group" name="state" value="1"
                                           th:checked="${record.state != null and record.state == '1'}">已读取</input>
                                </div>
                            </div>
                        </div>
                        <!--操作-->
                        <div class="am-form-group">
                            <div class="am-u-sm-10 am-u-sm-push-2">

                                <button type="button" onclick="return doSubmit();"
                                        class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交
                                </button>
                                <button type="button" onclick="loadPage('deviceInformation/listUI')"
                                        class="am-btn am-btn-success tpl-btn-bg-color-success ">返回
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<script th:inline="javascript">
    <![CDATA[
    //$('select').selected();
    validateUserForm();

    function validateUserForm() {
        valdater = $('#deviceInformationForm').validate({
            errorElement: 'span',
            errorClass: 'am-icon-times',
            focusInvalid: true,
            onkeyup: false,
            ignore: "",
            rules: {
                title: {
                    required: true
                }
            },
            messages: {
                name: {
                    required: "请填写标题"
                }
            }
        });
    }

    function doSubmit() {
        if (valdater.form()) {
            commit('deviceInformationForm', 'deviceInformation/addState', 'deviceInformation/listUI');
            return true;
        }
        return false;
    }

    ]]>
</script>
<script type="text/javascript" th:src="@{/My97DatePicker/WdatePicker.js}"/>